package com.cms.work.service.impl.transaction;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.work.core.service.impl.BaseServiceImpl;
import com.cms.work.dao.transaction.ITransactionDao;
import com.cms.work.entity.transaction.Transaction;
import com.cms.work.service.transaction.ITransactionService;

/**
 * @describe 交易流水
 * @author YY
 * @version v1.0
 * @date 2016-11-24 21:02:49
 **/
@Service
public class TransactionServiceImpl extends BaseServiceImpl<Transaction, Integer> implements ITransactionService {
	
    @Autowired
    private ITransactionDao transactionDao;
	
	@Override
	public void save(Transaction transaction) {
	    if (transaction.getId() == null || transaction.getId() == 0) {
            transactionDao.insertSelective(transaction);
        } else {
            transactionDao.updateByPrimaryKeySelective(transaction);
        }
	}
}

